﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Meraz.Core.Repositories;
using Meraz.Core.Model;

namespace Meraz.Core.Commands
{
    public interface IGetBlogCommand
    {
        IBlogRepository BlogRepository { get; set; }

        Blog Execute(string url);
    }
    public class GetBlogCommand : BaseCommand, IGetBlogCommand
    {
        public GetBlogCommand(IBlogRepository blogRepository)
        {
            this.BlogRepository = blogRepository;
        }
        public IBlogRepository BlogRepository { get; set; }

        public Blog Execute(string url)
        {
            return BlogRepository.GetByUrl(url);
        }
        public Blog Execute(BlogKeyType blogKeyType)
        {
            throw new NotImplementedException();
        }
    }
}
